<template>

	<div id="app">
		<div id="beautiful_country">
			<div id="item_name"></div>
			<div id="app">
				<ul class="am-avg-sm-2">
					<li class="beautiful_list" v-for="b in articles" @click="itemClicked(b)">
						<div class="pic">
							<img :src="'https://yo.docshare.org.cn'+b.background">
						</div>
						<div class="name">
							<img alt="" class="head" :src="'https://yo.docshare.org.cn'+b.headphoto">
							<span>{{b.individualitysignature}}</span>
							<div class="num">
								<i class="am-icon-eye"></i>
								<span>222</span>
								<i class="am-icon-comments"></i>
								<span>3</span>
							</div>
							<div class="clear"></div>
						</div>
						<label>{{b.name}}</label>
						<p>{{b.articletitle}}</p>
					</li>
				</ul>
			</div>
			<div id="none">
				没有更多了
			</div>
		</div>
		<div id="footer">
			<div class="first">
				<ul class="am-avg-sm-2">
					<li class="active">
						<a title=""  @click="uni.navigateTo({
							url:'index'
						})">
							<img src="https://yo.docshare.org.cn/static/images/icon-footer01-a.png" />
							<p>首页</p>
						</a>
					</li>
					<li>
						<a title=""  @click="uni.navigateTo({
							url:'../active/trip_list'
						})">
							<img alt="" src="https://yo.docshare.org.cn/static/images/icon-footer2-a.png" />
							<p>活动</p>
						</a>
					</li>
				</ul>
			</div>
			<div class="beautiful">
				<a title=""  @click="uni.navigateTo({
					url:'../add/my_note'
				})">
					<img alt="" src="https://yo.docshare.org.cn/static/images/icon-footer3-a.png" />
				</a>
			</div>
			<div class="last">
				<ul class="am-avg-sm-2">
					<li>
						<a title=""  @click="uni.navigateTo({
							url:'../map/map'
						})">
							<img alt="" src="https://yo.docshare.org.cn/static/images/icon-footer4-a.png" />
							<p>地图</p>
						</a>
					</li>
					<li>
						<a title=""  @click="uni.navigateTo({
							url:'../user/user_center'
						})">
							<img alt="" src="https://yo.docshare.org.cn/static/images/icon-footer5-a.png" />
							<p>我的</p>
						</a>
					</li>
				</ul>
			</div>
		</div>
	</div>
</template>

<script>
	import config from '@/config'
	export default 	{
		data() {
			return {
					uni,
			usr: '',
			articles: {},
			uni,
			}
		},
		methods: {
			itemClicked:function(item){
				//console.log("进入获取id")
				uni.navigateTo({
					url:`beautiful_detail?id=${item.id}`
				})
			}
		},
		onLoad() {
			var that = this;
			uni.request({
				url: `${config.baseUrl}/article/list?token=` + uni.getStorageSync('token'),
				method: 'GET',
				success(r) {
					if (r.data.succ) {
						that.articles = r.data.data;
			
					} else {
						// 可以给个弹窗提示
					}
				},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
			});
		}
	}
</script>

<style>
</style>
